package com.bi.design.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.bi.design.pojo.BaseModel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;

@Getter
@Setter
@TableName("device")
public class Device implements Serializable {

    private static final long serialVersionUID = 4226124790828615049L;

    @TableField("device_code")
    @TableId(value = "device_code", type = IdType.INPUT)
    private String deviceCode;

    @TableField("device_name")
    private String deviceName;

    @TableField("device_type")
    private String deviceType;

    @TableField("remarks")
    private String remarks;

    /**
     * 删除  未删除
     */
    @TableField("`deleted`")
    @TableLogic
    private Boolean deleted;

    /**
     * 新增执行
     */
    @TableField(value = "create_by", fill = FieldFill.INSERT)
    private String createBy;

    /**
     * 新增执行
     */
    @TableField(value = "create_by_name", fill = FieldFill.INSERT)
    private String createByName;

    /**
     * 新增和更新执行
     */
    @TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE)
    private String updateBy;


    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /**
     * 最后修改时间
     */
    @TableField("last_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastTime;

}
